﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Ch2_Notion_No1_Console
{
    class Program
    {
        static void Main(string[] args)
        {
            writeMsg("Peter");

            int? i =
              calc(1, 3);
            if (i.HasValue) writeMsg("has value");


            i = testNull() ?? 0;
            if (i.HasValue) writeMsg("has NULL value",i.ToString());


            Console.ReadKey();
                }

        static Nullable<int> testNull() { return null; }
        static int calc(int a,int b)
        {

            return a * b;
        }
        static void writeMsg(string nom)
        {
            writeMsg(nom, "mr");
        }
        static void writeMsg(string nom, string title = "")
        {
            Console.WriteLine("Allo " + title + " " + nom);
        }

        
    }
}
